321 - The New Villa (Grafos, BFS, bitwise)
[andmenj-acm.git] / 850 - Crypt kicker II / inputGen.cpp
blobb815693010766d58302a972a74c2581af198b824
1 #include <string>
2 #include <iostream>
4 using namespace std;
6 string text = "the quick brown fox jumps over the lazy dog";
7 int key;
9 void encrypt(string s){
10 for (int i=0; i<s.size(); ++i){
11 if (s[i] == ' '){
12 cout << " ";
13 continue;
15 char c = 'a' + ( (s[i]-'a'+key )%26 );
16 cout << c;
18 cout << endl;
21 int main(){
22 while(cin >> key && key){;
23 string s;
24 getchar();
25 getline(cin, s);
26 encrypt(text);
27 encrypt(s);